package com.itheima.sh.dao;

import com.itheima.sh.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

//1.定义接口
public interface UserMapper {
    //登录方法
    @Select("select * from user where username=#{username} and password=#{password}")
    User login(User user);

    //在接口中定义根据用户名查询的方法
    @Select("select * from user where username=#{username}")
    User inquire(@Param("username") String username);

    //添加用户方法
    @Insert("insert into user values (null ,#{username},#{password})")
    void register(User user);
}
